home *** CD-ROM | disk | FTP | other *** search
/ Champak 62 / Volume 62 - JOGO DISK .iso / Games / my-shop-dress-up.swf / scripts / frame_103 / DoAction.as
Text File  |  2008-03-17  |  2KB  |  100 lines

  1. function setSelected(side, clip, frame)
  2. {
  3.    _root[clip + side].gotoAndStop(frame);
  4.    switch(clip)
  5.    {
  6.       case "top":
  7.          _root["chardata" + side][0] = frame;
  8.          break;
  9.       case "bottom":
  10.          _root["chardata" + side][1] = frame;
  11.          break;
  12.       case "purse":
  13.          _root["chardata" + side][2] = frame;
  14.          break;
  15.       case "shoe":
  16.          _root["chardata" + side][3] = frame;
  17.    }
  18. }
  19. stop();
  20. head1.swapDepths(10);
  21. head2.swapDepths(20);
  22. h1x = head1._x;
  23. h1y = head1._y;
  24. h2x = head2._x;
  25. h2y = head2._y;
  26. chardata1 = ["top","bottom","purse","shoe"];
  27. chardata2 = ["top","bottom","purse","shoe"];
  28. if(selectedChar1 == 1)
  29. {
  30.    body2.gotoAndStop(2);
  31.    arm2.gotoAndStop(2);
  32.    attachMovie("head" + selectedChar1,"head2",20);
  33.    head2._x = h2x;
  34.    head2._y = h2y;
  35.    body1.gotoAndStop(1);
  36.    arm1.gotoAndStop(1);
  37.    attachMovie("head" + selectedChar2,"head1",10);
  38.    head1._x = h1x;
  39.    head1._y = h1y;
  40. }
  41. else if(selectedChar2 == 1)
  42. {
  43.    body2.gotoAndStop(2);
  44.    arm2.gotoAndStop(2);
  45.    attachMovie("head" + selectedChar2,"head2",20);
  46.    head2._x = h2x;
  47.    head2._y = h2y;
  48.    body1.gotoAndStop(1);
  49.    arm1.gotoAndStop(1);
  50.    attachMovie("head" + selectedChar1,"head1",10);
  51.    head1._x = h1x;
  52.    head1._y = h1y;
  53. }
  54. else
  55. {
  56.    body2.gotoAndStop(1);
  57.    arm2.gotoAndStop(1);
  58.    attachMovie("head" + selectedChar2,"head2",20);
  59.    head2._x = h2x;
  60.    head2._y = h2y;
  61.    head2._xscale = -100;
  62.    body1.gotoAndStop(1);
  63.    arm1.gotoAndStop(1);
  64.    attachMovie("head" + selectedChar1,"head1",10);
  65.    head1._x = h1x;
  66.    head1._y = h1y;
  67. }
  68. btn_top1.onPress = function()
  69. {
  70.    _root.setSelected(1,"top",this._currentframe + 1);
  71. };
  72. btn_bottom1.onPress = function()
  73. {
  74.    _root.setSelected(1,"bottom",this._currentframe + 1);
  75. };
  76. btn_shoe1.onPress = function()
  77. {
  78.    _root.setSelected(1,"shoe",this._currentframe + 1);
  79. };
  80. btn_purse1.onPress = function()
  81. {
  82.    _root.setSelected(1,"purse",this._currentframe + 1);
  83. };
  84. btn_top2.onPress = function()
  85. {
  86.    _root.setSelected(2,"top",this._currentframe + 1);
  87. };
  88. btn_bottom2.onPress = function()
  89. {
  90.    _root.setSelected(2,"bottom",this._currentframe + 1);
  91. };
  92. btn_purse2.onPress = function()
  93. {
  94.    _root.setSelected(2,"purse",this._currentframe + 1);
  95. };
  96. btn_shoe2.onPress = function()
  97. {
  98.    _root.setSelected(2,"shoe",this._currentframe + 1);
  99. };
  100.